/**
 *  @component
 *  @按钮组件封装
 */

import React, { Component } from 'react';
import { StyleSheet, View, Text, TouchableHighlight } from 'react-native';

export default class AppBtn extends Component {

  static defaultProps = {
    handle: Function,
  };

  constructor(props) {
    super(props);
    this.state = { count: 0 };
  };  

  render() {
    return (
      <View style={styles.touchBox}>
        <TouchableHighlight style={styles.touchbar} onPress={this.props.handle}>
          <Text style={styles.loginTxt}>{this.props.name}</Text>
        </TouchableHighlight>
      </View>
    );
  };
};

const styles = StyleSheet.create({
  touchBox: {
    height: 60,
  },
  touchbar: {
    flex: 1,
    borderRadius: 6,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#ffffff',
  },
  loginTxt: {
    fontSize: 24,
    fontWeight: '600',
    color: '#229bf3'
  }
});